/* 
 * TableColumns.java 
 * 
 * Copyright 2009 Handlewell Beijing Inc. 
 * All rights reserved. 
 * 
 * Created on 2009-8-24 
 */
package com.handlewell.generator.support;

/**
 * 功能概述： <br>
 * 
 * 数据库表列属性类
 * 
 * @author 倪敏
 * 
 */
public class TableColumns {

	/** 表名 */
	private String tableName;
	/** 数据库字段名 */
	private String dbColumnName;
	/** 属性名 */
	private String columnName;
	/** 数据库字段类型 */
	private String columnType;
	/** java类型 */
	private String javaType;
	/** 字段长度 */
	private int columnSize;
	/** 字段小数位长度 */
	private int columnDecimalDigits;
	/** 备注 */
	private String remark;
	/** 是否为主键 */
	private boolean prikey;
	/** 是否允许为空 */
	private boolean nullable;
	
	//--add by wangfeng2012-07-03
	private String columnZhName;

	/**
	 * 把字符串的第一个字母变大写
	 */
	public String getFirstLetterUpper(String colname) {
		String f = colname.substring(0, 1);
		f = f.toUpperCase();
		return f.concat(colname.substring(1));
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public String getDbColumnName() {
		return dbColumnName;
	}

	public void setDbColumnName(String dbColumnName) {
		this.dbColumnName = dbColumnName;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	public String getColumnType() {
		return columnType.toUpperCase();
	}

	public void setColumnType(String columnType) {
		this.columnType = columnType;
	}

	public String getJavaType() {
		return javaType;
	}

	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}

	public int getColumnSize() {
		return columnSize;
	}

	public void setColumnSize(int columnSize) {
		this.columnSize = columnSize;
	}

	public int getColumnDecimalDigits() {
		return columnDecimalDigits;
	}

	public void setColumnDecimalDigits(int columnDecimalDigits) {
		this.columnDecimalDigits = columnDecimalDigits;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public boolean isPrikey() {
		return prikey;
	}

	public void setPrikey(boolean prikey) {
		this.prikey = prikey;
	}

	public boolean isNullable() {
		return nullable;
	}

	public void setNullable(boolean nullable) {
		this.nullable = nullable;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer("TableColumns={");
		sb.append("tableName=" + this.tableName + ",");
		sb.append("dbColumnName=" + this.dbColumnName + ",");
		sb.append("columnName=" + this.columnName + ",");
		sb.append("columnType=" + this.columnType + ",");
		sb.append("javaType=" + this.javaType + ",");
		sb.append("columnSize=" + this.columnSize + ",");
		sb.append("columnDecimalDigits=" + this.columnDecimalDigits + ",");
		sb.append("remark=" + this.remark + ",");
		sb.append("prikey=" + this.prikey + ",");
		sb.append("nullable=" + this.nullable);
		sb.append("columnZhName=" + this.columnZhName);
		sb.append("}");

		return sb.toString();
	}

	public String getColumnZhName() {
		return columnZhName;
	}

	public void setColumnZhName(String columnZhName) {
		this.columnZhName = columnZhName;
	}
}
